<!DOCTYPE html>  
<html xmlns:th="http://www.thymeleaf.org" lang="zh-CN"> 
<head> 
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
	<meta name="viewport" content="width=device-width, initial-scale=1"/>
	<title>已下架商品管理</title>
	<!-- 常规css -->
    <link th:href="@{bootstrap/css/bootstrap.min.css}" rel="stylesheet" />
    <link th:href="@{font-awesome/css/font-awesome.min.css}" rel="stylesheet" />
    <!-- 项目css -->
    <link th:href="@{css/layout.css}" rel="stylesheet" />
</head> 
<body th:with="asort=${#httpServletRequest.getParameter('sort')}, aorder=${#httpServletRequest.getParameter('order')}, num=${data.num}, pageIndex=${data.pageIndex}">
	<!-- 侧边导航栏 -->
	<div th:replace="aframe::sideNavigation"></div>
	
	<!-- 主页面 -->
	<div class="content" style="padding:0">
		<!-- 顶部导航栏 -->
		<div th:replace="aframe::topNavigation"></div>
		<!-- 内容 -->

		<!-- 标签页内容 -->
		<div role="tabpanel" class="tab-pane active" id="history" style="margin:20px">
			<div class="panel panel-default" >
				<div class="panel-heading">
					<h4>已下架商品&nbsp;&nbsp;</h4>
				</div>
				<div class="panel-body table-responsive">
					<table class="table table-hover">
						<thead>
						<tr>
							<th th:if="${asort != 1+''}"><a th:href="@{goodsDown(sort=1,order=1,pageIndex=1,num=${num})}">编号<i class="fa fa-fw fa-sort"></i></a></th>
							<th th:if="${asort == 1+'' && aorder == 1+''}"><a th:href="@{goodsDown(sort=1,order=-1,pageIndex=1,num=${num})}">编号<i class="fa fa-fw fa-sort-asc"></i></a></th>
							<th th:if="${asort == 1+'' && aorder == -1+''}"><a th:href="@{goodsDown(sort=1,order=1,pageIndex=1,num=${num})}">编号<i class="fa fa-fw fa-sort-desc"></i></a></th>
							<th>商品名</th>
							<th>图片</th>
							<th>类目</th>
							<th th:if="${asort != 2+''}"><a th:href="@{goodsDown(sort=2,order=1,pageIndex=1,num=${num})}">价格<i class="fa fa-fw fa-sort"></i></a></th>
							<th th:if="${asort == 2+'' && aorder == 1+''}"><a th:href="@{goodsDown(sort=2,order=-1,pageIndex=1,num=${num})}">价格<i class="fa fa-fw fa-sort-asc"></i></a></th>
							<th th:if="${asort == 2+'' && aorder == -1+''}"><a th:href="@{goodsDown(sort=2,order=1,pageIndex=1,num=${num})}">价格<i class="fa fa-fw fa-sort-desc"></i></a></th>
							<th th:if="${asort != 3+''}"><a th:href="@{goodsDown(sort=3,order=1,pageIndex=1,num=${num})}">库存<i class="fa fa-fw fa-sort"></i></a></th>
							<th th:if="${asort == 3+'' && aorder == 1+''}"><a th:href="@{goodsDown(sort=3,order=-1,pageIndex=1,num=${num})}">库存<i class="fa fa-fw fa-sort-asc"></i></a></th>
							<th th:if="${asort == 3+'' && aorder == -1+''}"><a th:href="@{goodsDown(sort=3,order=1,pageIndex=1,num=${num})}">库存<i class="fa fa-fw fa-sort-desc"></i></a></th>
							<th th:if="${asort != 4+''}"><a th:href="@{goodsDown(sort=4,order=1,pageIndex=1,num=${num})}">销量<i class="fa fa-fw fa-sort"></i></a></th>
							<th th:if="${asort == 4+'' && aorder == 1+''}"><a th:href="@{goodsDown(sort=4,order=-1,pageIndex=1,num=${num})}">销量<i class="fa fa-fw fa-sort-asc"></i></a></th>
							<th th:if="${asort == 4+'' && aorder == -1+''}"><a th:href="@{goodsDown(sort=4,order=1,pageIndex=1,num=${num})}">销量<i class="fa fa-fw fa-sort-desc"></i></a></th>
							<th>商家</th>
							<th th:if="${asort != 5+''}"><a th:href="@{goodsDown(sort=5,order=1,pageIndex=1,num=${num})}">入库时间<i class="fa fa-fw fa-sort"></i></a></th>
							<th th:if="${asort == 5+'' && aorder == 1+''}"><a th:href="@{goodsDown(sort=5,order=-1,pageIndex=1,num=${num})}">入库时间<i class="fa fa-fw fa-sort-asc"></i></a></th>
							<th th:if="${asort == 5+'' && aorder == -1+''}"><a th:href="@{goodsDown(sort=5,order=1,pageIndex=1,num=${num})}">入库时间<i class="fa fa-fw fa-sort-desc"></i></a></th>
							<th th:if="${asort != 6+''}"><a th:href="@{goodsDown(sort=6,order=1,pageIndex=1,num=${num})}">修改时间<i class="fa fa-fw fa-sort"></i></a></th>
							<th th:if="${asort == 6+'' && aorder == 1+''}"><a th:href="@{goodsDown(sort=6,order=-1,pageIndex=1,num=${num})}">修改时间<i class="fa fa-fw fa-sort-asc"></i></a></th>
							<th th:if="${asort == 6+'' && aorder == -1+''}"><a th:href="@{goodsDown(sort=6,order=1,pageIndex=1,num=${num})}">修改时间<i class="fa fa-fw fa-sort-desc"></i></a></th>
							<th>操作</th>
						</tr>
						</thead>
						<tbody>
						<tr th:each="good: ${data.list}">
							<th scope="row" th:text="${good?.goodsId}">编号</th>
							<td th:text="${good?.goodsName}">商品名</td>
							<td><button type="button" class="btn btn-default btn-sm" th:text="查看" data-toggle="modal" th:data-target="'#showImgModal'+${good?.goodsId}"></button></td>
							<!-- 图片显示模态框 -->
							<div class="modal fade text-center" th:id="'showImgModal'+${good?.goodsId}">
								<div class="modal-dialog modal-lg" style="display: inline-block; max-height: 800px; width: auto;">
									<div class="modal-content">
										<img th:src="${good?.goodsPic}" style="max-height: 820px">
									</div>
								</div>
							</div>
							<div th:switch="${good?.goodsType}">
								<td th:case="0">不限</td>
								<td th:case="1">食品/保健类</td>
								<td th:case="2">服饰类</td>
								<td th:case="3">皮具箱包类</td>
								<td th:case="4">珠宝饰品类</td>
								<td th:case="5">母婴/儿童类</td>
								<td th:case="6">家电类</td>
								<td th:case="7">数码类</td>
								<td th:case="8">汽车配件类</td>
								<td th:case="9">家具/建材类</td>
								<td th:case="10">图书影音类</td>
							</div>
							<td th:text="${good?.goodsPrice}">价格</td>
							<td th:text="${good?.goodsStock}">库存</td>
							<td th:text="${good?.goodsSales}">销量</td>
							<td th:text="${good?.shopName}">商家</td>
							<td th:text="${#dates.format(good?.goodsTime, 'yyyy-MM-dd')}">录入时间</td>
							<td th:text="${#dates.format(good?.modifyTime, 'yyyy-MM-dd')}">修改时间</td>
							<td>
								<button class="btn btn-sm btn-info" th:onclick="showDetail([[${good?.goodsId}]])">查看</button>
								<button class="btn btn-sm btn-success"  th:onclick="showUpper([[${good?.goodsId}]])">上架</button>
								<button class="btn btn-sm btn-danger"  th:onclick="showDelete([[${good?.goodsId}]])">删除</button>
							</td>
						</tr>
						</tbody>
					</table>

					<!-- 分页 -->
					<div th:replace="aframe::pagingBar"></div>

				</div>
			</div>
		</div>
	</div>
		<!-- end 内容 -->
	<!-- end 主页面 -->

	<!-- 模态框: 信息 -->
	<form class="form-horizontal" role="form" id="detailForm" style="margin: 20px;">
		<div class="modal fade" id="detailModal" tabindex="-1" role="dialog" aria-labelledby="detailModalLabel" aria-hidden="true">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
						<h4 class="modal-title" id="detailModalLabel"> 商品信息 </h4>
					</div>
					<div class="modal-body">
						<div class="form-group">
							<label class="col-sm-3 control-label">商品名称</label>
							<div class="col-sm-7">
								<p class="form-control-static" id="d_goodsName"></p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">商品参数</label>
							<div class="col-sm-7">
								<p class="form-control-static" id="d_goodsParam"></p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">商品类目</label>
							<div class="col-sm-7">
								<p class="form-control-static" id="d_goodsType"></p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">商品图片</label>
							<div class="col-sm-7">
								<img class="form-control-static" id="d_goodsPic" alt="商品图片" style="height:100px;max-height: 100px">
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">商品价格</label>
							<div class="col-sm-7">
								<p class="form-control-static" id="d_goodsPrice"></p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">商品库存</label>
							<div class="col-sm-7">
								<p class="form-control-static" id="d_goodsStock"></p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">商品销量</label>
							<div class="col-sm-7">
								<p class="form-control-static" id="d_goodsSales"></p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">商家名称</label>
							<div class="col-sm-7">
								<p class="form-control-static" id="d_shopName"></p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">商品地址</label>
							<div class="col-sm-7">
								<p class="form-control-static" id="d_goodsAddr"></p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">加入时间</label>
							<div class="col-sm-7">
								<p class="form-control-static" id="d_goodsTime"></p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">修改时间</label>
							<div class="col-sm-7">
								<p class="form-control-static" id="d_modifyTime"></p>
							</div>
						</div>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
					</div>
				</div>
			</div>
		</div>
	</form>

	<!-- 模态框: 修改密码 -->
	<div th:replace="aframe::modifyPwd"></div>


<!-- 常规js -->
<script th:src="@{js/jquery-3.4.1.min.js}"></script>
<script th:src="@{bootstrap/js/bootstrap.min.js}"></script>
<!-- 模板js -->
<script th:replace="aframe::js-highlight"></script>
<!-- 项目js -->
<script th:src="@{js/md5.js}"></script>
<script th:src="@{js/setpwd.js}"></script>
<!-- 页面js -->
<script th:src="@{js/goodsDown.js}"></script>

</body>
</html> 

